Temporal reasoning functions are used in rules to compute results for, and express relationships that involve, attributes over multiple periods.
Be sure to use the exact syntax for these functions including spacing and parentheses as specified below.
Function | Example | Further information |
IntervalCountDistinct |
|
Calculate the number of distinct values for a variable in a time period |
IntervalCountDistinctIf |
|
Calculate the number of distinct values for a variable in a time period only when a condition is true |
IntervalDailySum |
|
Calculate the sum of a variable in a time period |
IntervalDailySumIf |
|
Calculate the sum of a variable in a time period only when a condition is true |
IntervalMaximum |
|
Find the maximum amount in a period |
IntervalMaximumIf |
|
Find the maximum amount in a period when a boolean attribute is true |
IntervalMinimum |
|
|
IntervalMinimumIf |
|
Find the minimum amount in a period when a boolean attribute is true |
IntervalWeightedAverage |
|
Calculate the average value of a variable in a time period |
IntervalWeightedAverageIf |
|
Calculate the average value of a variable in a time period when a condition is true |
IntervalAlways |
|
Check if a condition is true at all times in the time period |
IntervalAtLeastDays |
|
Check if a condition is true for at least the specified number of days in the time period |
IntervalConsecutiveDays |
|
Check if a condition is true for at least the specified number of consecutive days in the time period |
IntervalSometimes |
|
Check if a condition is ever true in the time period |
ValueAt |
|
Determine a rule attribute on a given date |
WhenLast |
|
Find the closest date when an attribute was true |
WhenNext |
|
Find the closest date when an attribute was true |
Latest |
|
Get a date value equivalent to the latest possible date |
Earliest |
|
Get a date value equivalent to the earliest possible date |
TemporalIsWeekday |
|
Calculate the weekdays in a given time period |
TemporalOncePerMonth |
|
Calculate a specific day in a month for a given time period |
TemporalDaysSince |
|
Calculate the number of days since a given date |
TemporalWeeksSince |
|
Calculate the number of weeks since a given date |
TemporalMonthsSince |
|
Calculate the number of months since a given date |
TemporalYearsSince |
|
Calculate the number of years since a given date |
TemporalAlwaysDays |
|
Check if a condition is true for all of a specified number of preceding days |
TemporalConsecutiveDays |
|
Check if a condition is true for at least the specified number of consecutive preceding days |
TemporalSometimesDays |
|
Check if a condition is ever true within a specified number of preceding days |
TemporalAfter |
|
Check if a condition is true after a given date and false on and before |
TemporalBefore |
|
Check if a condition is true before a given date and false on and afterwards |
TemporalOn |
|
Check if a condition is true on a given date and false before and afterwards |
TemporalOnOrAfter |
|
Check if a condition is true on or after a given date and false before |
TemporalOnOrBefore |
|
Check if a condition is true on and before a given date and false afterwards |
TemporalFromStartDate |
|
Get a temporal attribute from entity instances with values from the start date |
TemporalFromEndDate |
|
Get a temporal attribute from entity instances with values up until the end date |
TemporalFromRange |
|
Get a temporal attribute from entity instances with values from the start date until the end date |
TIP: The localized syntax for these functions may be viewed: